how to use the Kubernetes API